package website.digitalocean.chapter13;

/**
 * @Author: 582895699@qq.com
 * @Desctription:
 * @Date: Created in 2023/2/13 21:45
 */
public class ChatClient {
    public static void main(String[] args) {
        // 初始化一个新数组
        ChatMediator chatMediator = new ChatMediatorImpl();
        User user1 = new UserImpl(chatMediator, "A");
        User user2 = new UserImpl(chatMediator, "B");
        User user3 = new UserImpl(chatMediator, "C");
        User user4 = new UserImpl(chatMediator, "D");

        chatMediator.addUser(user1);
        chatMediator.addUser(user2);
        chatMediator.addUser(user3);
        chatMediator.addUser(user4);

        user1.send("good");
    }
}
